﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace wwl.DataAccess.Migrations.Rbac
{
    /// <inheritdoc />
    public partial class AddOprationType : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "operation_type",
                table: "rbac_user_role",
                type: "character varying(20)",
                maxLength: 20,
                nullable: false,
                defaultValue: "ASSIGN");

            migrationBuilder.AddColumn<string>(
                name: "operation_type",
                table: "rbac_role_permission",
                type: "character varying(20)",
                maxLength: 20,
                nullable: false,
                defaultValue: "ASSIGN");

            migrationBuilder.CreateIndex(
                name: "ix_rbac_user_role_operation_type",
                table: "rbac_user_role",
                column: "operation_type");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "ix_rbac_user_role_operation_type",
                table: "rbac_user_role");

            migrationBuilder.DropColumn(
                name: "operation_type",
                table: "rbac_user_role");

            migrationBuilder.DropColumn(
                name: "operation_type",
                table: "rbac_role_permission");
        }
    }
}
